//
//  MyCustomLabel.m
//  project_delicious
//
//  Created by dlios on 15-3-23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "MyCustomLabel.h"

@implementation MyCustomLabel

- (instancetype)initWithFrame:(CGRect)frame
{
    CGFloat widths = self.frame.size.width;
    CGFloat heights = self.frame.size.height;
    self = [super initWithFrame:frame];
    if (self) {
        self.myImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, widths / 8, heights / 3 - 10)];
        [self addSubview:self.myImageView];
        [_myImageView release];
        self.label = [[UILabel alloc] initWithFrame:CGRectMake(widths / 8 + 10, 0, widths / 2, heights / 3 - 10)];
        [self addSubview:self.label];
        [_label release];
        
        
        self.myPicImageView1 = [[UIImageView alloc] initWithFrame:CGRectMake(0, heights / 3, (widths - 20) / 3, (heights * 7 /15))];
        [self addSubview:self.myPicImageView1];
        [_myPicImageView1 release];
        self.picLabel1 = [[UILabel alloc] initWithFrame:CGRectMake(20, heights * 4 / 5, (widths - 20) / 3 - 20, heights / 5)];
        self.picLabel1.font = [UIFont systemFontOfSize:10];
        [self addSubview:self.picLabel1];
        [_picLabel1 release];
        
        self.myPicImageView2 = [[UIImageView alloc] initWithFrame:CGRectMake(0 + (widths - 20) / 3 + 10, heights / 3, (widths - 20) / 3, (heights * 7 /15))];
        [self addSubview:self.myPicImageView2];
        [_myPicImageView2 release];
        self.picLabel2 = [[UILabel alloc] initWithFrame:CGRectMake(20 + (widths - 20) / 3, heights * 4 / 5, (widths - 20) / 3 - 20, heights / 5)];
        self.picLabel2.font = [UIFont systemFontOfSize:10];
        [self addSubview:self.picLabel2];
        [_picLabel2 release];
        
        self.myPicImageView3 = [[UIImageView alloc] initWithFrame:CGRectMake(0 + (widths - 20) / 3 + 10, heights / 3, (widths - 20) / 3, (heights * 7 /15))];
        [self addSubview:self.myPicImageView3];
        [_myPicImageView3 release];
        self.picLabel3 = [[UILabel alloc] initWithFrame:CGRectMake(20 + (widths - 20) / 3 * 2, heights * 4 / 5, (widths - 20) / 3 - 20, heights / 5)];
        self.picLabel3.font = [UIFont systemFontOfSize:10];
        [self addSubview:self.picLabel3];
        [_picLabel3 release];
       
        
        self.userInteractionEnabled = YES;
    }
    return self;
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
